package service.interf;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import model.MResource;
import model.MResourceType;

public interface IResource {
	/**
	 * 获取所有资源和权限
	 * @return Map<String, ArrayList<String>>
	 * 		   String : 资源url
	 *         ArrayList<String> : 权限组
	 * @throws RuntimeException
	 * 2012-12-16下午01:37:06
	 */
	public Map<String, ArrayList<String>> findAllResourcesWithAuth() throws RuntimeException;
	
	
	/******************resource ************************/
	public String addResource(MResource model) throws Exception;
	public String delResource(MResource model) throws Exception;
	public String editResource(MResource model)throws Exception;
	
	//find
	public String findResourceById(Integer resourceId) throws Exception;
	public String findResourcesByType(Integer typeId, boolean detail,int pageno,int pagesize) throws Exception;
	public String findAllResources(boolean detail,int pageno, int pagesize) throws Exception;
	
	public String getResourceAuthorities(Integer resourceId) throws Exception;
	public String updateResourceAuthority(String resourceAuthorities) throws Exception;
	public String updateAuthorityResources(Integer authorityId,String authorityResources)throws Exception;
	
	//resource批量保存
	public String batchUpdate(String datas) throws Exception;
	public String batchReourceByFile(List<File> fl) throws Exception;
	
	//resourceType批量保存
	public String batchUpdateType(String datas) throws Exception;
	/*********************** resource type **********************/
	public String addResourceType(MResourceType model) throws Exception;
	public String delResourceType(MResourceType model) throws Exception;
	public String editResourceType(MResourceType model) throws Exception;
	public String findAllType() throws Exception;
	
	//根据权限获取资源
	public String getResourceByAuth(Integer authorityId)throws Exception;
	
}
